import os
import requests

html = requests.get('https://shanghai.douban.com/events/week-exhibition')
content = html.text
with open('info.html', 'w', encoding='utf-8') as fw:
    fw.write(content)

# if '摄影' in content:
#     print('可能有新的摄影展！请访问https://shanghai.douban.com/events/week-exhibition查看详细。')

if os.path.exists('last_count.txt'):
    with open('last_count.txt', 'r') as fr:
        last_count = int(fr.read())
else:
    last_count = 0
count = content.count('摄影')
if count != last_count and conte > 0:
    print('可能有新的摄影展！请访问https://shanghai.douban.com/events/week-exhibition查看详细。')
    with open('last_count.txt', 'w') as fw:
        fw.write(count)
